<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>
<style>
    body{
        margin: 0%;
        padding: 0%;
        overflow: hidden;
        width: 100%;
        height: 100vh;
    }
    #app{
        /* width: 100%; */
        /* 另一种效果 */
        width: 100px;
        height: 100px;
        overflow: hidden;
    }
    .div01{
        width: 100px;
        height: 100%;
        background-color: greenyellow;
        animation: donghua 4s;
    }
    @keyframes donghua {
        0%{
            transform: translateX(0px);
        }
        100%{
            transform: translateX(100px);
        }
    }
</style>
<body>
    <div id="app"></div>
</body>
<script>
    const app = Vue.createApp({
        data(){
            return{
                // 控制动画是否显示，一定要有外层包裹
                isshow:{
                     div01:true
                }
               
            }
        },
        template:`<div :class="isshow">动画效果</div>`
    })
    app.mount("#app")
</script>
</html>